import fetch from '@/utils/fetch'

export function getCollectNodeList(areaId, params) {
	return fetch({
	    url: '/device/v1/mgt/collect_node',
	    method: 'get',
		headers: {'x-area-id': areaId},
	    params
  	})
}

export function getCollectNodeDetail(id) {
	return fetch({
	    url: `/device/v1/mgt/collect_node/${id}`,
	    method: 'get'
  	})
}

export function createCollectNode(data) {
	return fetch({
		url: '/device/v1/mgt/collect_node',
		method: 'post',
		data
	})
}

export function modifyCollectNode(id, data) {
	return fetch({
	    url: `/device/v1/mgt/collect_node/${id}`,
	    method: 'patch',
	    data
	})
}

export const collectNodeTypeList = { //采集节点类型字段说明
	"1": "环境监控设备(供配电)",
	"2": "变压器",
	"3": "发电机",
	"4": "提排泵",
	"5": "消防主机",
	"6": "排水泵(变频泵)",
	"7": "生活水泵(变频泵)"
};


export const collectTypeList = { //数据采集类型字段说明
	"1": "RTU_DI",
	"2": "RTU_DO",
	"3": "RTU_AI1",
	"4": "RTU_AI2",
	"5": "RTU_AI3",
	"6": "RTU_AI4",
	"7": "RTU_AI5"
};